<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>何为数据代理</title>
    <!-- 通过一个对象代理另一个对象中属性的操作 -->
</head>
<body>
    
</body>
<script>
    let x = {
        number:100,
    }
    let x1 = {
        number:200,
    }

    Object.defineProperty(x1,'x',{
        get(){
            return x.number;
        },
        set(value){
            x.number = value
        }
    })
</script>
</html>